<?php

use think\migration\Seeder;

class Permission extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $data = [
            [
                'name' => 'All permission',
                'mark' => 'All permission',
                'path' => '*'
            ],
            [
                'name' => '用户管理-列表',
                'mark' => 'auth.user',
                'path' => 'user/index'
            ],
            [
                'name' => '用户管理-编辑',
                'mark' => 'auth.user',
                'path' => 'user/edit,user/del'
            ],
            [
                'name' => '角色管理-列表',
                'mark' => 'auth.role',
                'path' => 'role/index'
            ],
            [
                'name' => '角色管理-编辑',
                'mark' => 'auth.role',
                'path' => 'role/edit,role/del'
            ],
            [
                'name' => '菜单管理',
                'mark' => 'auth.menu',
                'path' => 'menu/index,menu/edit,menu/del'
            ],
            [
                'name' => '权限',
                'mark' => 'auth.permission',
                'path' => 'permission/index,permission/edit,permission/del'
            ]
        ];

        $permission = $this->table('permission');
        $permission->insert($data)->save();
    }
}